package cc.wsyw126.java.stream;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created by junpeng.yang on 16/8/24.
 */
public class FindWordToLowerSort {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new FileReader("/Users/yangdp/Desktop/新增任务.txt"));

        List<String> list = bf.lines().flatMap(line -> Stream.of(line.split(" ")).filter(word -> word.length()>0).map(word -> word.toLowerCase())).distinct().sorted().collect(Collectors.toList());

        bf.close();

        System.out.println("list.size() = " + list.size());
        System.out.println("list = " + list);



    }
}
